var validatorPhone = function(rule, value, callback) {
  if (value === '') {
    callback(new Error('请输入联系方式'))
  } else if (!/^1\d{10}$/.test(value)) {
    callback(new Error('请输入正确的联系方式'))
  } else {
    callback()
  }
}

const validate = {
  name1: [
    {
      required: true,
      message: '请输入名称',
      trigger: 'change'
    }
  ],
  name2: [
    {
      required: true,
      trigger: 'change',
      validator: validatorPhone
    },
    { type: 'number', message: '请输入正确的联系方式' }
  ],
  name3: [
    {
      required: true,
      message: '请输入提成费率',
      trigger: 'change'
    }
  ]
}
export default validate
